/*
区间DP,按照字串长度从小到大枚举
dp[i][j]:i~j一共有多少合法序列

dp[i][j][0]:i~j全是*
dp[i][j][1]:(...)
dp[i][j][2]:(...)..* 
dp[i][j][3]:(..).(...) 第二种状态也属于这种
dp[i][j][4]:*..(...)
dp[i][j][5]:*..(...)..* 第一种状态也属于这种

转移方程：
compare(i, j) 第i位和第j位能否匹配成()
dp[l][r][0]==1

dp[l][r][1]=(dp[l+1][r-1][0]+dp[l+1][r-1][2]+dp[l+1][r-1][3]+dp[l+1][r-1][4])*compare(l, r)

dp[l][r][2]=累加(i=l~r-1)dp[l][i][3]*dp[i+1][r][0]
    括号开头，*结尾

dp[l][r][3]=累加(i=l~r-1)(dp[l][i][2]+dp[l][i][3])*dp[i+1][r][1]+dp[l][r][1]

dp[l][r][4]=累加(i=l~r-1)(dp[l][i][4]+dp[l][i][5])*dp[i+1][r][1]

dp[l][r][5]=累加(i=l~r-1)dp[l][i][4]*dp[i+1][r][0]+dp[l][r][0]

dp[i][i-1][0]=1;

*/
#define quickread
#ifdef quickread
#include <cstdio> 
template <typename T>
inline void read(T& x)
{
    int c=getchar(), f=1; x=0;
    while(c<'0'||'9'<c) {if(c=='-') f=-1; c=getchar();}
    while('0'<=c&&c<='9') 
        x=(x<<3)+(x<<1)+c-'0', c=getchar();
    x*=f;
}
template <typename T>
inline void quickwrite(T x)
{
    if(x>=10) quickwrite(x/10);
    putchar(x%10+'0');
}
#else 
#include <iostream>
#endif

using namespace std;

#define DEBUG
#define mod(x) ((x)%MOD+MOD)%MOD
using ll=long long;
const int N=510, MOD=1e9+7;
char str[N];
ll dp[N][N][6];
int n, k;

bool compare(int a, int b) 
{
    return (str[a]=='('||str[a]=='?')&&(str[b]==')'||str[b]=='?');
}

void init()
{
    read(n); read(k);
    scanf("%s", str+1);

    for(int i=1; i<=n; i++) dp[i][i-1][0]=1;
}

void solve()
{
    init();
    for(int len=1; len<=n; len++)
    {
        for(int l=1; l<=n-len+1; l++)
        {
            int r=l+len-1;
            if(len<=k) //当前这个区间存在全变为*的可能
                dp[l][r][0]=dp[l][r-1][0]&&(str[r]=='*'||str[r]=='?');
        
            if(len>=2)
            {
                //(...)
                if(compare(l, r)) dp[l][r][1]=mod(dp[l+1][r-1][0]+dp[l+1][r-1][2]+dp[l+1][r-1][3]+dp[l+1][r-1][4]);
                for(int i=l; i<=r-1; i++)
                {
                    //( *
                    dp[l][r][2]=mod(dp[l][r][2]+dp[l][i][3]*dp[i+1][r][0]);
                    //()()
                    dp[l][r][3]=mod(dp[l][r][3]+(dp[l][i][2]+dp[l][i][3])*dp[i+1][r][1]);
                    //**()
                    dp[l][r][4]=mod(dp[l][r][4]+(dp[l][i][4]+dp[l][i][5])*dp[i+1][r][1]);
                    //**()**
                    dp[l][r][5]=mod(dp[l][r][5]+dp[l][i][4]*dp[i+1][r][0]);
                }  
            }
            dp[l][r][5]=mod(dp[l][r][5]+dp[l][r][0]); 
            dp[l][r][3]=mod(dp[l][r][3]+dp[l][r][1]); 
        }
    }
    quickwrite(dp[1][n][3]); puts("");
}

signed main()
{
    #ifdef DEBUG
        freopen("./in.txt", "r", stdin);
        freopen("./out.txt", "w", stdout);
    #endif
    #ifndef quickread
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    #endif

    int T=1; //scanf("%d", &T);
    while(T--) 
    {
        solve();
    }
    return 0;
}